package com.zhouzj.task.springcloud.code.repo;

import com.zhouzj.task.springcloud.code.domain.LagouAuthCode;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Date;
import java.util.List;

/**
 * @Author: zhouzhijun
 * @Date: 2021/8/5 13:39
 */
public interface LagouAuthCodeRepo extends JpaRepository<LagouAuthCode, Integer> {

    Boolean existsByEmailAndExpireTimeAfterAndCode(String email, Date expire, String code);

    Boolean existsByEmailAndExpireTimeAfter(String email, Date expire);

    List<LagouAuthCode> findByEmailAndExpireTimeAfter(String email, Date expire);
}
